﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Script.Serialization;

namespace QLKS.Views
{
    public class CheckCode : IHttpHandler
    {
        public void ProcessRequest(HttpContext context)
        {
            QLKS.Entity.DMNguoiDung obj = new Entity.DMNguoiDung();
            obj.TenNguoiDung = context.Request.Params["username"];
            List<QLKS.Entity.DMNguoiDung> user = QLKS.BLL.DMNguoiDungBUS.GetByAll(obj);
            string json = "{ \"result\": \"0\" }"; 
            if (user.Count > 0)
            {
                json = "{ \"result\": \"1\" }";     
            }
            context.Response.ContentType = "application/json";
            context.Response.Write(json);
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}